<template>
  <el-table :data="userOrderList" border style="width: 100%">
    <el-table-column fixed prop="order_num" label="订单号" width="190" />
    <el-table-column prop="full_name" label="租赁人" width="80" />
    <el-table-column prop="phone" label="手机号码" width="120" />
    <el-table-column label="租赁日期" width="320">
      <template #default="{ row }">
        {{ format(row.start, 'yyyy-MM-dd HH:mm:ss') + ' - ' + format(row.end, 'yyyy-MM-dd HH:mm:ss') }}
      </template>
    </el-table-column>
    <el-table-column prop="rent" label="每日租金" width="80" />
    <el-table-column prop="license_number" label="车牌号码" width="100" />
    <el-table-column prop="shopName" label="门店" width="160" />
    <el-table-column prop="address" label="详细地址" width="300" />
    <el-table-column prop="tel" label="联系方式" width="150" />
    <el-table-column label="是否归还" width="60">
      <template #default="{ row }">
        {{ row.is_rend == 1 ? '否' : '是' }}
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
  export default {
    name: 'Order',
    data() {
      return { format }
    },
    mounted() {
      this.reqOrderList()
    },
    methods: {
      ...mapActions('order', ['reqOrderList']),
    },
    computed: {
      ...mapGetters('order', ['userOrderList']),
      test() {
        return JSON.parse(JSON.stringify(this.orderList))
      },
    },
  }
</script>

<style scoped></style>
